<include file="Common:iframe_header"/>
<include file="articleTpl"/>
<include file="Common:iframe_footer"/>
<script type="text/javascript" src="__PUBLIC__/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugins/ueditor/ueditor.all.js"></script>
<script type="text/javascript">
    layui.config({
        base: "{:C(JS_BASE_PATH)}"
    }).use(['jquery','func','layer','form'],function () {
        var $ = layui.jquery,
                func = layui.func,
                layer = layui.layer,
                form = layui.form();
        var ur = UE.getEditor('content');

        form.on("submit(add)",function (data) {
            var params = data.field;
            func.ajax("{:U('add')}",params,function (msg) {
                if(msg.respCode !== 10000){
                    layer.msg(msg.respMsg);
                    return false;
                }
                layer.msg('文章发布成功！');
                setTimeout(function () {
                    window.location.href="{:U(index)}";
                },"1000")
            })
        })
    });
</script>